package cn.com.homeyoda.aimate.aihealth.ui.game.analysis;

import android.os.Bundle;
import android.view.View;

import androidx.lifecycle.ViewModelProviders;

import cn.com.homeyoda.aimate.aihealth.BR;
import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.app.AppViewModelFactory;
import cn.com.homeyoda.aimate.aihealth.base.BaseActivity;
import cn.com.homeyoda.aimate.aihealth.base.BaseViewModel;
import cn.com.homeyoda.aimate.aihealth.data.Repository;
import cn.com.homeyoda.aimate.aihealth.databinding.ActivityGameAnalysisBinding;

public class GameAnalysisActivity extends BaseActivity<ActivityGameAnalysisBinding, BaseViewModel<Repository>> implements View.OnClickListener {

    @Override
    public BaseViewModel<Repository> initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(BaseViewModel.class);
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_game_analysis;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        binding.ivBack.setOnClickListener(this);
        binding.btnComplete.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.iv_back || v.getId() == R.id.btn_complete) {
            finish();
        }
    }

}